package com.best.eureka.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Jiang Akang
 * employeeId: BG435424
 * @date 2021/7/23
 **/
@RestController
@RequestMapping("/provider")
public class ProviderController {

    @Value("${server.port}")
    String port;

    @GetMapping("/find/instance")
    public String service(@RequestHeader("token") String token) {

        String applicationName = "provider";
        String result = applicationName + "-" +  port;

        System.out.println("**********" + result);

        System.out.println("token: " + token);

        return result;
    }

}
